package com.jwdf.uda.http.action;

import android.content.Context;

import com.jwdf.uda.bean.PbBean;
import com.jwdf.uda.http.AHttpService;
import com.jwdf.uda.http.ApiService;

import retrofit2.Call;

/**
 * 类说明：
 * 作者：huangqiuxin on 2016/5/17 16:18
 * 邮箱：648859026@qq.com
 */
public class UserMessageListAction extends AHttpService<PbBean.PbResUserGetMessageList>{
    /**
     * 获取消息列表
     * @param context
     * @param offset
     * @return
     */
    public static UserMessageListAction newInstance(Context context, int offset){
        return new UserMessageListAction(context, offset);
    }

    private int offset;
    private UserMessageListAction(Context context, int offset) {
        super(context);
        this.offset = offset;
    }

    @Override
    protected Call newRetrofitCall(ApiService apiService, PbBean.PbBaseClientInfo.Builder baseBuilder) {
        PbBean.PbReqUserGetMessageList.Builder builder = PbBean.PbReqUserGetMessageList.newBuilder();
        builder.setBaseClientInfo(baseBuilder);
        builder.setOffset(offset);

        return apiService.getMessageList(builder.build());
    }
}
